package autohotkeyide;

import bsh.EvalError;
import com.ciklum.robotester.IRobotesterApi;
import com.ciklum.robotester.RobotesterImpl;


public class Interpreter {

    

    public boolean execute(String text) {
        bsh.Interpreter interpreter = new bsh.Interpreter();
        interpreter.setOut(System.out);
        interpreter.setErr(System.err);
        interpreter.getNameSpace().importObject(getRobotester());
        try {
            interpreter.eval(text);
        } catch (EvalError ex) {
            ex.printStackTrace();
        }
        return true;
    }
    
    private IRobotesterApi getRobotester() {
        return new RobotesterImpl(3000);
    }
}
